﻿
@{
    Layout = "_Layout";
}
<div class="row">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>修改密码</h5>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class=" col-lg-3">
                    <div class="form-group"><label>原密码</label> <input type="password" placeholder="原密码" class="form-control" v-model="pwd"></div>
                    <div class="form-group"><label>新密码</label> <input type="password" placeholder="新密码" class="form-control" v-model="pwd1"></div>
                    <div class="form-group"><label>新密码</label> <input type="password" placeholder="新密码" class="form-control" v-model="pwd2"></div>
                    <button type="button" class="btn btn-primary pull-left" v-on:click="mdy_pwd">确认修改</button>
                </div>

            </div>


        </div>
    </div>
</div>
<script>
    var vue = new Vue({
        el: "#bind",
        data: {
            pwd: "",
            pwd1: "",
            pwd2: ""
        },
        methods: {
            mdy_pwd: function () {
                var _this = this;
                if (_this.pwd == "" || _this.pwd1 == "" || _this.pwd2 == "") {
                    alert("密码不能为空");
                }
                if (_this.pwd1 != _this.pwd2) {
                    alert("两次密码不一致");
                }
                post("/home/UpdatePass", { oldPass: _this.pwd, newPass: _this.pwd1 }, function (data) {
                    if (data) {
                        alertDo("密码修改成功", function () {
                            location.href = "/login/out";
                        }, "success");
                    } else {
                        alert("密码修改失败", "error");
                    }
                })
            },
        }
    });
</script>